package org.jie.study.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jie.study.entity.auth.Account;
import org.jie.study.entity.user.AccountUser;

/**
 * @author jie
 * @date 2024/10/20 21:52
 */
@Mapper
public interface UserMapper {

    @Select("select * from db_account where username = #{text} or email = #{text}")
    Account findAccountByNameOrEmail(String text);

    @Select("select * from db_account where username = #{text} or email = #{text}")
    AccountUser findAccountUserByNameOrEmail(String text);

    @Insert("insert into db_account(email, username, password) values(#{email}, #{username}, #{password})")
    int createAccount(String username, String password, String email);
}
